Ext.define('PC.model.DetalheAtivoModel',{
    extend: 'Ext.data.Model',
    fields: [
             {name: 'codigo'},
             {name: 'ativo'},
             {name: 'preco'},
             {name: 'oscilacao'},
             {name: 'limCompra'},
             {name: 'limVenda'},
             {name: 'datahora'}
    ],    
    
    proxy: {
		type : 'rest',
        format: 'json',
        url: 'InvestindoServlet',
        appendId: false, //default, it prevents the id.json at the URL
        
        reader: Ext.create('Ext.data.JsonReader', {
		    successProperty: 'success',
			idProperty: 'id',
			totalProperty: 'totalCount',
		    root: 'ativos'
		}),
		
        writer: Ext.create('Ext.data.JsonWriter', {
		    encode: false,
		    writeAllFields: true,
		    root: 'ativos'
		})
    }
});